home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3s
/
tmpfile.z
/
tmpfile
Wrap
Text File
|
1998-10-20
|
2KB
|
67 lines
TTTTMMMMPPPPFFFFIIIILLLLEEEE((((3333SSSS)))) TTTTMMMMPPPPFFFFIIIILLLLEEEE((((3333SSSS))))
NNNNAAAAMMMMEEEE
tmpfile - create a temporary file
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
FFFFIIIILLLLEEEE ****ttttmmmmppppffffiiiilllleeee ((((vvvvooooiiiidddd))));;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_t_m_p_f_i_l_e creates a temporary file, and returns a corresponding FILE
pointer. The file is created on the temporary directory indicated by the
string PPPP____ttttmmmmppppddddiiiirrrr in <_s_t_d_i_o._h>. If the file cannot be opened, a NULL
pointer is returned. Upon return from _t_m_p_f_i_l_e, you may print an error
message using _p_e_r_r_o_r(3C), to determine the reason for the failure. A
success call to _t_m_p_f_i_l_e will create a temporary file just long enough to
obtain the FILE pointer, then delete the file with _u_n_l_i_n_k(_2), and finally
return the FILE pointer to the calling process. Thus, the only means of
accessing the temporary file is though the FILE pointer. The file is
opened for update ("w+").
Although the name of the temporary file is generated similarly to those
produced by _t_m_p_n_a_m(3S), _t_m_p_f_i_l_e uses its own algorithm to generate
filenames similar to, but unique from, those generated by _t_m_p_n_a_m. This
allocates the entire space of _t_m_p_n_a_m-generated names to applications
code. (See _t_m_p_n_a_m(3S) for more information.)
SSSSEEEEEEEE AAAALLLLSSSSOOOO
creat(2), unlink(2), fopen(3S), mktemp(3C), perror(3C), stdio(3S),
tmpnam(3S).
PPPPaaaaggggeeee 1111